//
//  HZZFHttpOperation.h
//  HZZFNetworking
//
//  Created by 早范 on 2025/7/7.
//
//

#import <Foundation/Foundation.h>

@class HZZFHttpOperation;
typedef void(^HZZFHttpOperationCompletionBlock)(HZZFHttpOperation *operation, NSURLSessionDataTask *dataTask, NSData *data, NSError *error);

@interface HZZFHttpOperation : NSOperation

@property (nonatomic, strong, readonly) NSURLRequest *URLRequest;
@property (nonatomic, strong, readonly) NSURLSessionDataTask *dataTask;

@property (nonatomic, readonly, strong) NSURLResponse *response;
@property (nonatomic, readonly, strong) NSData *responseObject;
@property (nonatomic, readonly, strong) NSError *error;

+ (instancetype)operationWithRequest:(NSURLRequest *)URLRequest;
- (instancetype)initWithRequest:(NSURLRequest *)URLRequest;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)new NS_UNAVAILABLE;

- (void)setCompletion:(HZZFHttpOperationCompletionBlock)completion;

@end
